const _import = filePath => () => import('../views/' + filePath + '.vue')

export default [
  // 首页
  {
    path: '/index',
    name: 'index',
    component: _import('index'),
    meta: { appHeader: 'show', appSldebar: 'show', name: 'index' }
  },
  // 公告
  {
    path: '/notice',
    name: 'notice',
    component: _import('notice/index'),
    meta: { appHeader: 'show', appSldebar: 'show', viewHeader: 'show', name: 'index', title: '发布公告' }
  },
  {
    path: '/login',
    name: 'login',
    component: _import('login/index'),
    meta: { name: 'login' }
  },
  // 首页管理
  {
    path: '/index/manage',
    name: 'indexManage',
    component: _import('indexManage/index'),
    meta: { name: 'indexManage' },
    redirect: { name: 'indexBanner' },
    children: [
      // 首页banner
      {
        path: 'banner',
        name: 'indexBanner',
        component: _import('indexManage/banner'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'indexManage', title: '首页轮播图' }
      },
      // 业态管理
      {
        path: 'styles',
        name: 'indexStyles',
        component: _import('indexManage/styles'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'indexManage', title: '业态管理' }
      },
      // 活动设置
      {
        path: 'activity',
        name: 'indexActivity',
        component: _import('indexManage/activity'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'indexManage', title: '活动设置' }
      },
      // 经典案例设置
      {
        path: 'case',
        name: 'indexCase',
        component: _import('indexManage/case/index'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'indexManage', title: '经典案例设置' },
        redirect: { name: 'caseList' },
        children: [
          {
            path: 'list',
            name: 'caseList',
            component: _import('indexManage/case/list'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'indexManage' }
          },
          {
            path: 'detail/:id',
            name: 'caseDetail',
            component: _import('indexManage/case/detail'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'indexManage', title: '案例详情' }
          }
        ]
      },
      // 品质材料商设置
      {
        path: 'supplier',
        name: 'indexSupplier',
        component: _import('indexManage/supplier'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'indexManage', title: '品质材料商设置' }
      },
      // 热门材料设置
      {
        path: 'material',
        name: 'indexMaterial',
        component: _import('indexManage/material/index'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'indexManage', title: '热门材料设置' },
        redirect: { name: 'hotMaterialList' },
        children: [
          {
            path: 'list',
            name: 'hotMaterialList',
            component: _import('indexManage/material/list'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'indexManage' }
          },
          {
            path: 'detail/:id',
            name: 'hotMaterialDetail',
            component: _import('indexManage/material/detail'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'indexManage', title: '材料详情' }
          }
        ]
      }
    ]
  },
  // 用户管理
  {
    path: '/user/manage',
    name: 'userManage',
    component: _import('userManage/index'),
    meta: { name: 'userManage' },
    redirect: { name: 'userDesigner' },
    children: [
      // 设计师用户
      {
        path: 'designer',
        name: 'userDesigner',
        component: _import('userManage/designer'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'userManage', title: '设计师用户' }
      },
      // 供应商用户
      {
        path: 'supplier',
        name: 'userSupplier',
        component: _import('userManage/supplier/index'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'userManage', title: '供应商用户' },
        redirect: { name: 'supplierList' },
        children: [
          {
            path: 'list',
            name: 'supplierList',
            component: _import('userManage/supplier/list'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'userManage' }
          },
          {
            path: 'auditList',
            name: 'supplierAuditList',
            component: _import('userManage/supplier/auditList'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'userManage', title: '审核列表' }
          }
        ]
      },
    ]
  },
  // 品牌管理
  {
    path: '/brand/manage',
    name: 'brandManage',
    component: _import('brandManage/index'),
    meta: { name: 'brandManage',title: '品牌管理', sidebar: 'show', appHeader: 'show', },
    redirect: { name: 'brandBase' },
    children: [
      {
        path: 'base',
        name: 'brandBase',
        component: _import('brandManage/base'),
        meta: {name: 'brandManage', title: '品牌库', appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', }
      },
      {
        path: 'audit',
        name: 'audit',
        component: _import('brandManage/audit/index'),
        meta: {name: 'brandManage',title: '品牌列表', appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show',  viewHeader: 'show' },
        redirect: { name: 'brandList' },
        children: [
          {
            path:'list',
            name:'brandList',
            component: _import('brandManage/audit/list'),
            meta: {name: 'brandManage', appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show',  }
          },
          {
            path:'auditList',
            name:'auditList',
            component: _import('brandManage/audit/auditList'),
            meta: {name: 'brandManage', title: '审核列表', appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', }
          }
        ]
      }
    ]
  },
  // 材料管理
  {
    path: '/material/manage',
    name: 'materialManage',
    component: _import('materialManage/index'),
    meta: { name: 'materialManage' },
    redirect: { name: 'material' },
    children: [
      // 材料列表
      {
        path: 'material',
        name: 'material',
        component: _import('materialManage/material/index'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'materialManage', title: '材料列表' },
        redirect: { name: 'materialList' },
        children: [
          // 列表
          {
            path: 'list',
            name: 'materialList',
            component: _import('materialManage/material/list'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'materialManage' }
          },
          // 审核列表
          {
            path: 'auditList',
            name: 'materialAuditList',
            component: _import('materialManage/material/auditList'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'materialManage', title: '审核列表' }
          },
          // 材料详情
          {
            path: 'detail/:id',
            name: 'materialDetail',
            component: _import('materialManage/material/detail'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'materialManage', title: '材料详情' }
          }
        ]
      },
      // 材料分类
      {
        path: 'category',
        name: 'materialCategory',
        component: _import('materialManage/category'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'materialManage', title: '材料分类' },
      },
      // 找材料列表
      {
        path: 'find/material',
        name: 'findMaterial',
        component: _import('materialManage/findMaterial/index'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'materialManage', title: '找材料列表' },
        redirect: { name: 'findMaterialList' },
        children: [
          // 列表
          {
            path: 'list',
            name: 'findMaterialList',
            component: _import('materialManage/findMaterial/list'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'materialManage' }
          },
          // 审核列表
          {
            path: 'auditList',
            name: 'findMaterialAuditList',
            component: _import('materialManage/findMaterial/auditList'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'materialManage', title: '审核列表' },
          },
          // 材料详情
          {
            path: 'detail/:id',
            name: 'findMaterialDetail',
            component: _import('materialManage/findMaterial/detail'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'materialManage', title: '找材料详情' }
          }
        ]
      },
    ]
  },
  // 拼版
  {
    path: '/puzzle',
    name: 'puzzle',
    component: _import('puzzle/index'),
    meta: { name: 'puzzle' },
    redirect: { name: 'puzzleTemplate' },
    children: [
      // 模板
      {
        path: 'template',
        name: 'puzzleTemplate',
        component: _import('puzzle/template/index'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'puzzle', title: '模板设置' },
        redirect: { name: 'templateList' },
        children: [
          {
            path: 'list',
            name: 'templateList',
            component: _import('puzzle/template/list'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'puzzle' }
          },
          {
            path: 'edit/:id?',
            name: 'templateEdit',
            component: _import('puzzle/template/edit'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'puzzle', title: '编辑' }
          }
        ]
      },
      // 列表
      {
        path: 'list',
        name: 'puzzleList',
        component: _import('puzzle/list'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'puzzle', title: '拼版列表' }
      }
    ]
  },
  // 人员管理
  {
    path: '/person/manage',
    name: 'personManage',
    component: _import('personManage/index'),
    meta: { name: 'personManage' },
    redirect: { name: 'memberManage' },
    children: [
      // 成员管理
      {
        path: 'member',
        name: 'memberManage',
        component: _import('personManage/member'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'personManage', title: '成员管理' }
      },
      // 角色管理
      {
        path: 'role',
        name: 'roleManage',
        component: _import('personManage/role'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'personManage', title: '角色管理' }
      }
    ]
  },
  // 小程序管理
  {
    path: '/applets/manage',
    name: 'appletsManage',
    component: _import('appletsManage/index'),
    meta: { name: 'appletsManage' },
    redirect: { name: 'homeRecManage' },
    children: [
      // 首页推荐设置
      {
        path: 'homeRec',
        name: 'homeRecManage',
        component: _import('appletsManage/homeRec'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'appletsManage', title: '首页推荐设置' }
      },
      // 分类热门商家设置
      {
        path: 'hotSupplier',
        name: 'hotSupplierManage',
        component: _import('appletsManage/hotSupplier'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'appletsManage', title: '分类热门商家设置' }
      },
      // 分享设置
      {
        path: 'share',
        name: 'shareManage',
        component: _import('appletsManage/share'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'appletsManage', title: '分享设置' }
      },
      // 材料分类图片设置
      {
        path: 'materialImg',
        name: 'materialImgManage',
        component: _import('appletsManage/materialImg'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'appletsManage', title: '材料分类图片设置' }
      },
      // 意见反馈
      {
        path: 'suggestion',
        name: 'suggestionManage',
        component: _import('appletsManage/suggestion'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'appletsManage', title: '意见反馈' }
      },
      // 名师文章管理
      {
        path: 'article',
        name: 'articleManage',
        component: _import('teacher/articleManage'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'appletsManage', title: '名师文章管理' }
      },
      // 素材库
      {
        path: 'material',
        name: 'teacherMaterial',
        component: _import('teacher/teacherMaterial'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'appletsManage', title: '素材库' }
      },
      // 草稿箱
      {
        path: 'draft',
        name: 'teacherDraft',
        component: _import('teacher/teacherDraft'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'appletsManage', title: '草稿箱' }
      },
      // 文章分类管理
      {
        path: 'category',
        name: 'teacherCategory',
        component: _import('teacher/teacherCategory'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'appletsManage', title: '文章分类管理' }
      },
      {
        path: 'material/video/edit/:id?',
        name: 'editVideoMaterial',
        component: _import('teacher/editVideoMaterial'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'appletsManage', title: '素材库' }
      }
    ]
  },
  // 其他管理
  {
    path: '/other/manage',
    name: 'otherManage',
    component: _import('otherManage/index'),
    meta: { name: 'otherManage' },
    redirect: { name: 'otherCase' },
    children: [
      // 案例列表
      {
        path: 'case',
        name: 'otherCase',
        component: _import('otherManage/cases/index'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'otherManage', title: '案例列表' },
        redirect: { name: 'otherCaseList' },
        children: [
          // 列表
          {
            path: 'list',
            name: 'otherCaseList',
            component: _import('otherManage/cases/list'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'otherManage' }
          },
          // 审核列表
          {
            path: 'auditList',
            name: 'otherCaseAuditList',
            component: _import('otherManage/cases/auditList'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'otherManage', title: '审核列表' }
          },
          // 材料详情
          {
            path: 'detail/:id',
            name: 'otherCaseDetail',
            component: _import('otherManage/cases/detail'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'otherManage', title: '案例详情' }
          }
        ]
      },
      // 订单管理
      {
        path: 'order',
        name: 'order',
        component: _import('otherManage/order/index'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'otherManage', title: '订单列表' },
        redirect: { name: 'orderList' },
        children: [
          // 列表
          {
            path: 'list',
            name: 'orderList',
            component: _import('otherManage/order/list'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'otherManage' }
          },
          // 审核列表
          {
            path: 'orderAuditList',
            name: 'orderAuditList',
            component: _import('otherManage/order/auditList'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'otherManage', title: '审核列表' }
          },
          // 材料详情
          {
            path: 'detail/:id',
            name: 'orderDetail',
            component: _import('otherManage/order/detail'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'otherManage', title: '案例详情' }
          }
        ]
      },
      {
        path: 'books',
        name: 'books',
        component: _import('otherManage/books'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'otherManage', title: '白皮书管理' }
      },
      // 供应商入库管理
      {
        path: 'supplier/storage',
        name: 'supplierStorage',
        component: _import('otherManage/supplier/index'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'otherManage', title: '供应商入库管理' },
        redirect: { name: 'supplierStorageList' },
        children: [
          // 列表
          {
            path: 'list',
            name: 'supplierStorageList',
            component: _import('otherManage/supplier/list'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'otherManage' }
          },
          // 列表
          {
            path: 'auditList',
            name: 'supplierStorageAuditList',
            component: _import('otherManage/supplier/auditList'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'otherManage', title: '入库审核列表' }
          },
          // 列表
          {
            path: 'failList',
            name: 'supplierStorageFailList',
            component: _import('otherManage/supplier/failList'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'otherManage', title: '入库审核列表' }
          },
          // 详情
          {
            path: 'detail/:id',
            name: 'supplierStorageDetail',
            component: _import('otherManage/supplier/detail'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'otherManage', title: '供应商入库申请详情页' }
          }
        ]
      }
    ]
  },
  // 系统管理
  {
    path: '/system/manage',
    name: 'systemManage',
    component: _import('systemManage/index'),
    meta: { name: 'systemManage' },
    redirect: { name: 'systemLog' },
    children: [
      // 日志管理
      {
        path: 'log',
        name: 'systemLog',
        component: _import('systemManage/log'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'systemManage', title: '日志管理' }
      },
      // 字典管理
      {
        path: 'dictionary',
        name: 'systemDictionary',
        component: _import('systemManage/dictionary'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'systemManage', title: '字典管理' }
      }
    ]
  },
  // 发布文章
  {
    path: '/editArticle/:id?',
    name: 'editArticle',
    component: _import('teacher/editArticle')
  },
  // 预览文章
  {
    path: '/previewArticle/:id?',
    name: 'previewArticle',
    component: _import('teacher/previewArticle')
  },
  // 发布视频文章
  {
    path: '/editVideo/:id?',
    name: 'editVideo',
    component: _import('teacher/editVideo')
  },
  // 预览文章
  {
    path: '/previewVideo/:id?',
    name: 'previewVideo',
    component: _import('teacher/previewVideo')
  },
  // 在线入库调查
  {
    path: '/survey',
    name: 'survey',
    component: _import('survey/index')
  },
  // 物料间管理
  {
    path: '/storeroom/manage',
    name: 'storeroomManage',
    component: _import('storeroom/index'),
    meta: { name: 'storeroomManage' },
    redirect: { name: 'storeSample' },
    children: [
      {
        path: 'sample',
        name: 'storeSample',
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'storeroomManage', title: '样品列表' },
        component: _import('storeroom/sample/index'),
        redirect: { name: 'sampleList' },
        children: [
          // 样品列表
          {
            path: 'list',
            name: 'sampleList',
            component: _import('storeroom/sample/list'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'storeroomManage' }
          },
          {
            path: 'record/:id',
            name: 'sampleRecord',
            component: _import('storeroom/sample/record'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'storeroomManage', title: '样品日志' }
          },
        ]
      },
      
      // 样品入库
      {
        path: 'storage',
        name: 'storeroomStorage',
        component: _import('storeroom/storage/index'),
        meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'storeroomManage', title: '样品入库' },
        redirect: { name: 'storageMenu' },
        children: [
          {
            path: 'menu',
            name: 'storageMenu',
            component: _import('storeroom/storage/menu'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'storeroomManage' }
          },
          // 样品入库
          {
            path: 'upload/:id?',
            name: 'storageUpload',
            component: _import('storeroom/storage/upload'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'storeroomManage', title: '新增样品' }
          },
          // 关联材料
          {
            path: 'material',
            name: 'storageMaterial',
            component: _import('storeroom/storage/material'),
            meta: { appHeader: 'show', lowerSidebar: 'show', appSldebar: 'show', viewHeader: 'show', name: 'storeroomManage', title: '关联平台材料信息' }
          }
        ]
      },
    ]
  }
]